#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QMessageBox>
#include <QDebug>
#include<QLineEdit>

#include<keyboard.h>
namespace Ui {
class Login;
}

class Login : public QWidget
{
    Q_OBJECT

public:
    explicit Login(QWidget *parent = nullptr);
    ~Login();

    bool eventFilter(QObject *obj, QEvent *event);

protected:

private slots:
    void on_pushButton_clicked();
signals:
    void LoginSeccess();
private:
    // 初始化数据库连接
    void initDatabase();
    QSqlDatabase db;
    // 从数据库加载账号到ComboBox
    void loadUsernamesToComboBox();
    keyboard * keyboard_ui;
    Ui::Login *ui;
};

#endif // LOGIN_H
